public class Test {
    public static void main4(String[] args) {
        TwoProngedTree twoProngedTree=new TwoProngedTree();
        TwoProngedTree.TreeNode root = twoProngedTree.createTree();
        System.out.println("获取第4层节点的个数:"+twoProngedTree.getKLevel(root, 4));
        System.out.println("获取第3层节点的个数:"+twoProngedTree.getKLevel(root, 3));
        System.out.println("获取二叉树的高度："+twoProngedTree.getHeight(root));
        System.out.println(twoProngedTree.contains(root,'H'));
    }
    public static void main3(String[] args) {
        TwoProngedTree twoProngedTree=new TwoProngedTree();
        TwoProngedTree.TreeNode root = twoProngedTree.createTree();
        System.out.println(twoProngedTree.getLeafSize(root));
        System.out.println(twoProngedTree.getLeafNodeCount(root));
    }
    public static void main2(String[] args) {
        TwoProngedTree twoProngedTree=new TwoProngedTree();
        TwoProngedTree.TreeNode root = twoProngedTree.createTree();
        System.out.println("递归："+twoProngedTree.recursionSize(root));
        System.out.println("遍历："+twoProngedTree.traverseSize(root));

    }
    public static void main1(String[] args) {
        TwoProngedTree tree = new TwoProngedTree();
        // 构建二叉树并获取根节点
        TwoProngedTree.TreeNode root = tree.createTree();
        System.out.print("前序遍历结果：");
        tree.preOrder(root);
        System.out.println();
        System.out.print("中序遍历结果：");
        tree.inOrder(root);
        System.out.println();
        System.out.print("后序遍历结果：");
        tree.postOrder(root);
        System.out.println();
    }
//    static class TreeNode{
//        public int val;//数据域
//        public TreeNode left;//左孩子的引用，常常代表左孩子为根的整颗左子树
//        public TreeNode right;//右孩子的引用，常常代表右孩子为根的整颗右子树
//    }
//    static class TreeNode{
//        public int val;//数据域
//        public TreeNode  left;//左孩子的引用，常常代表左孩子为根的整颗左子树
//        public TreeNode  right;//右孩子的引用，常常代表右孩子为根的整颗右子树
//        public TreeNode parent;//当前节点的根节点
//
//    }
}
